#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#endif

#include "irrlichtDevice.h"
#include "videoDriver.h"
#include "sceneManager.h"
#include "guiEnvironment.h"
#include "animatedMesh.h"
#include "staticText.h"
#include "terrain.h"
#include "referenceCounted.h"
#include "sceneNode.h"
#include "OSOperator.h"
#include "cameraSceneNode.h"
#include "fileSystem.h"
#include "cursorControl.h"
#include "guiElement.h"
#include "sceneNodeAnimator.h"
#include "timer.h"
#include "EventReceiverProxy.h"
#include "material.h"

extern "C" __declspec(dllexport) IrrlichtDevice* CreateNewInstance(unsigned int deviceType, unsigned int width, unsigned int height,
	unsigned int bits, bool fullscreen, bool stencilBuffer, bool vSync)
{
	video::E_DRIVER_TYPE type;
	switch(deviceType)
	{
	case 0:
		type = video::EDT_NULL;
		break;
	case 1:
		type = video::EDT_SOFTWARE;
		break;
	case 2:
		type = video::EDT_BURNINGSVIDEO;
		break;
	case 3:
		type = video::EDT_DIRECT3D8;
		break;
	case 4:
		type = video::EDT_DIRECT3D9;
		break;
	case 5:
		type = video::EDT_OPENGL;
		break;
	case 6:
		type = video::EDT_COUNT;
		break;
	}

	EventReceiverProxy *receiver = new EventReceiverProxy();

	IrrlichtDevice* device = createDevice(type, dimension2d<u32>(width, height), bits, fullscreen, stencilBuffer, vSync, receiver);
	return device;
}

